﻿using System.Collections.Generic;
using System.Threading.Tasks;

using KSOAdmin.IServices.System;
using KSOAdmin.Models.DomainModels.System;
using KSOAdmin.Models.ViewModel;

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;

namespace KSOAdmin.WebApi.Controllers
{
    /// <summary>
    /// 测试
    /// </summary>
    [ApiExplorerSettings(GroupName = "系统")]
    public class HomeController : BaseApiControllers
    {
        private readonly ISys_UserServices _UserServices;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="UserServices"></param>
        public HomeController(  ISys_UserServices UserServices)
        {
            _UserServices = UserServices;
        }
        /// <summary>
        /// 测试
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        [Route("Index")]
        [AllowAnonymous]
        public async Task<string> Index()
        {
            List<Sys_User> sys_Users = await _UserServices.FindListAsync(w=>true);
            View_Sys_User view = new View_Sys_User();
            var ss = await _UserServices.LoginVerificationAsync(view);
            return Newtonsoft.Json.JsonConvert.SerializeObject(sys_Users);
        }
    }
}
